#pragma once

#include <QList>
#include <QString>
#include "VFunctions.h"

class VWords
{
public:
    explicit VWords(){}
    explicit VWords(QString name, QString type_name, QString signature, int line, int kind);
    VWords(VWords * source);

	~VWords();

    enum MATCH {
        NAME        = 0x00000000,
        TYPENAME    = 0x00000001
    };

    enum KIND
    {
        MARCO       = 0x00000001,
        PROTOTYPE   = 0x00000002,
        FUNCTION    = 0x00000004,
        VARIABLE    = 0x00000008,
        PARAMETER   = 0x00000010,
        EXTERNVAR   = 0x00000020,
        FILE        = 0x00000040,
        KEYWORD     = 0x00000080,
        LOCAL       = 0x00000100,
        ENUMERATOR  = 0x00000200,
        ENUM        = 0x00000400,
        STRUCT      = 0x00000800,
        MEMBER      = 0x00001000,
        UNION       = 0x00002000,
        TYPEDEF     = 0x00004000,
        TEMPLATE    = 0x00008000,
        LABEL       = 0x00010000,
        FOLDER      = 0x00020000
    };

    enum MODE
    {
        ALL,
        PART
    };

    int _kind;
    int _line;

	QString _name;
    QString _type_name;
    QString _signature;
    QList<VWords*> _list;
    void *_file;

    void clear();
    void append(VWords *child);
    bool matching(QString text, int kind, int match, int line, int mode);
    VWords* matching_child(QString text, int kind, int match, int line, int mode);
    QList<VWords*> matching_childs(QString text, int kind, int match, int line, int mode);

    void set_file(void* file);

};

